import re

# MidName:What????如何非贪心匹配，做出What?
nameRegex = re.compile(r'FirstName:(.*)LastName:(.*)MidName:(.*?)?')
mo = nameRegex.search('FirstName:Al,LastName:Sweigart.MidName:What????')
print(mo.group(1))
print(mo.group(2))
print(mo.group(3))
